package com.chinasoft.set01.set01;

import java.util.TreeSet;

public class Test01 {
    public static void main(String[] args) {
        //TreeSet
        TreeSet<Student> ts = new TreeSet<>();
        //创建学生对象
        Student s1 = new Student("zhangsan",28);
        Student s2 = new Student("lisi",27);
        Student s3 = new Student("wangwu",29);
        Student s4 = new Student("zhaoliu",26);
        Student s5 = new Student("dali",28);

        ts.add(s1);
        ts.add(s2);
        ts.add(s3);
        ts.add(s4);
        ts.add(s5);

        for (Student student:ts) {
            System.out.println( student);
        }

    }
}